#!/bin/bash

if [ "$#" -ne 3 ] ; then
    echo "Usage: wasagent.sh {hostname|host_ip} {port} {'param1=value<;w;c>[&param2=value2<;w;c>][&...&parmamN=value<;w;c>]'}"
    exit 1
fi

wget -q -O - http://${1}:${2}/wasagent/WasAgent --post-data=$3 2> /dev/null | awk -F\| '{ print $2"|"$3  ; exit $1 }'
        
exit $?
